/**
 * Created by kaki on 2017/10/20.
 */
import fetch from '@/utils/fetch'
// 显示所有课程
export const GetSchdules = () => {
  return fetch({
    url: '/api/staff/schedules/extra-info',
    method: 'get'
  })
}

export const CreateSchdules = (data) => {
  return fetch({
    url: '/api/staff/schedules',
    method: 'post',
    data
  })
}

export const GetAllSchdulesCourse = (params, page = 1) => {
  return fetch({
    url: `/api/staff/schedules-courses?page=${page}`,
    method: 'get',
    params
  })
}

export const GetOneSchdulesCourse = (id) => {
  return fetch({
    url: `/api/staff/schedules-courses/${id}?include=course,coach,classroom,schedules_course`,
    method: 'get'
  })
}

// 更新一节课
export const postOnceSchdulesCourse = (id, data) => {
  return fetch({
    url: `/api/staff/schedules-courses/${id}`,
    method: 'put',
    data
  })
}
